using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.H_InterfaceTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HL_InterfaceTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HL_InterfaceTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HL_Interface";
			dataTableMapping.ColumnMappings.Add("InterfaceName", "InterfaceName");
			dataTableMapping.ColumnMappings.Add("InterfaceID", "InterfaceID");
			dataTableMapping.ColumnMappings.Add("InterfaceFrontUrl", "InterfaceFrontUrl");
			dataTableMapping.ColumnMappings.Add("InterfaceAdminUrl", "InterfaceAdminUrl");
			dataTableMapping.ColumnMappings.Add("EnableFrontInterface", "EnableFrontInterface");
			dataTableMapping.ColumnMappings.Add("EnableAdminInterface", "EnableAdminInterface");
			dataTableMapping.ColumnMappings.Add("RegClose", "RegClose");
			dataTableMapping.ColumnMappings.Add("LoginClose", "LoginClose");
			dataTableMapping.ColumnMappings.Add("InterfaceType", "InterfaceType");
			dataTableMapping.ColumnMappings.Add("Version", "Version");
			dataTableMapping.ColumnMappings.Add("AdminLoginUrl", "AdminLoginUrl");
			dataTableMapping.ColumnMappings.Add("AdminLoginOpenType", "AdminLoginOpenType");
			dataTableMapping.ColumnMappings.Add("AdminLoginPassword", "AdminLoginPassword");
			dataTableMapping.ColumnMappings.Add("UpdateTime", "UpdateTime");
			dataTableMapping.ColumnMappings.Add("CrossDomain", "CrossDomain");
			dataTableMapping.ColumnMappings.Add("UserCenterUrl", "UserCenterUrl");
			dataTableMapping.ColumnMappings.Add("CodePage", "CodePage");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HL_Interface] WHERE (([InterfaceID] = @Original_InterfaceID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_InterfaceID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "InterfaceID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HL_Interface] ([InterfaceName], [InterfaceFrontUrl], [InterfaceAdminUrl], [EnableFrontInterface], [EnableAdminInterface], [RegClose], [LoginClose], [InterfaceType], [Version], [AdminLoginUrl], [AdminLoginOpenType], [AdminLoginPassword], [UpdateTime], [CrossDomain], [UserCenterUrl], [CodePage]) VALUES (@InterfaceName, @InterfaceFrontUrl, @InterfaceAdminUrl, @EnableFrontInterface, @EnableAdminInterface, @RegClose, @LoginClose, @InterfaceType, @Version, @AdminLoginUrl, @AdminLoginOpenType, @AdminLoginPassword, @UpdateTime, @CrossDomain, @UserCenterUrl, @CodePage)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@InterfaceName", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "InterfaceName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@InterfaceFrontUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "InterfaceFrontUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@InterfaceAdminUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "InterfaceAdminUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@EnableFrontInterface", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "EnableFrontInterface", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@EnableAdminInterface", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "EnableAdminInterface", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@RegClose", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "RegClose", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@LoginClose", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "LoginClose", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@InterfaceType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "InterfaceType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Version", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Version", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AdminLoginUrl", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AdminLoginUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AdminLoginOpenType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AdminLoginOpenType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AdminLoginPassword", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AdminLoginPassword", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UpdateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "UpdateTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@CrossDomain", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "CrossDomain", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UserCenterUrl", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "UserCenterUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@CodePage", SqlDbType.Char, 0, ParameterDirection.Input, 0, 0, "CodePage", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HL_Interface] SET [InterfaceName] = @InterfaceName, [InterfaceFrontUrl] = @InterfaceFrontUrl, [InterfaceAdminUrl] = @InterfaceAdminUrl, [EnableFrontInterface] = @EnableFrontInterface, [EnableAdminInterface] = @EnableAdminInterface, [RegClose] = @RegClose, [LoginClose] = @LoginClose, [InterfaceType] = @InterfaceType, [Version] = @Version, [AdminLoginUrl] = @AdminLoginUrl, [AdminLoginOpenType] = @AdminLoginOpenType, [AdminLoginPassword] = @AdminLoginPassword, [UpdateTime] = @UpdateTime, [CrossDomain] = @CrossDomain, [UserCenterUrl] = @UserCenterUrl, [CodePage] = @CodePage WHERE (([InterfaceID] = @Original_InterfaceID))";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@InterfaceName", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "InterfaceName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@InterfaceFrontUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "InterfaceFrontUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@InterfaceAdminUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "InterfaceAdminUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@EnableFrontInterface", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "EnableFrontInterface", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@EnableAdminInterface", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "EnableAdminInterface", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@RegClose", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "RegClose", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@LoginClose", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "LoginClose", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@InterfaceType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "InterfaceType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Version", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Version", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AdminLoginUrl", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AdminLoginUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AdminLoginOpenType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AdminLoginOpenType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AdminLoginPassword", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AdminLoginPassword", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@UpdateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "UpdateTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@CrossDomain", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "CrossDomain", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@UserCenterUrl", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "UserCenterUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@CodePage", SqlDbType.Char, 0, ParameterDirection.Input, 0, 0, "CodePage", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_InterfaceID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "InterfaceID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[6];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT InterfaceName, InterfaceID, InterfaceFrontUrl, InterfaceAdminUrl, \r\n      EnableFrontInterface, EnableAdminInterface, RegClose, LoginClose, InterfaceType, \r\n      Version, AdminLoginUrl, AdminLoginOpenType, AdminLoginPassword, UpdateTime, \r\n      CrossDomain, UserCenterUrl, CodePage\r\nFROM HL_Interface";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "DELETE FROM [HL_Interface] WHERE (([InterfaceID] = @InterfaceID))";
			this._commandCollection[1].CommandType = CommandType.Text;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@InterfaceID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "InterfaceID", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "SELECT AdminLoginOpenType, AdminLoginPassword, AdminLoginUrl, CrossDomain, EnableAdminInterface, EnableFrontInterface, InterfaceAdminUrl, InterfaceFrontUrl, InterfaceID, InterfaceName, InterfaceType, LoginClose, RegClose, UpdateTime, UserCenterUrl, Version,CodePage FROM HL_Interface WHERE (EnableFrontInterface = 1) AND (LoginClose = 0)";
			this._commandCollection[2].CommandType = CommandType.Text;
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "SELECT AdminLoginOpenType, AdminLoginPassword, AdminLoginUrl, CrossDomain, EnableAdminInterface, EnableFrontInterface, InterfaceAdminUrl, InterfaceFrontUrl, InterfaceID, InterfaceName, InterfaceType, LoginClose, RegClose, UpdateTime, UserCenterUrl, Version,CodePage FROM HL_Interface WHERE (RegClose = 0) AND (EnableFrontInterface = 1)";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "SELECT AdminLoginOpenType, AdminLoginPassword, AdminLoginUrl, CrossDomain, \r\n      EnableAdminInterface, EnableFrontInterface, InterfaceAdminUrl, InterfaceFrontUrl, \r\n      InterfaceID, InterfaceName, InterfaceType, LoginClose, RegClose, UpdateTime, \r\n      UserCenterUrl, Version, CodePage\r\nFROM HL_Interface\r\nWHERE (InterfaceID = @InterfaceID)";
			this._commandCollection[4].CommandType = CommandType.Text;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@InterfaceID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "InterfaceID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5] = new SqlCommand();
			this._commandCollection[5].Connection = this.Connection;
			this._commandCollection[5].CommandText = "SELECT AdminLoginOpenType, AdminLoginPassword, AdminLoginUrl, CrossDomain, \r\n      EnableAdminInterface, EnableFrontInterface, InterfaceAdminUrl, InterfaceFrontUrl, \r\n      InterfaceID, InterfaceName, InterfaceType, LoginClose, RegClose, UpdateTime, \r\n      UserCenterUrl, Version, CodePage\r\nFROM HL_Interface";
			this._commandCollection[5].CommandType = CommandType.Text;
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Interface.HL_InterfaceDataTable GetInterfaceName()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			H_Interface.HL_InterfaceDataTable hL_InterfaceDataTable = new H_Interface.HL_InterfaceDataTable();
			this.Adapter.Fill(hL_InterfaceDataTable);
			return hL_InterfaceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Interface.HL_InterfaceDataTable GetFrontLoginInterface()
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			H_Interface.HL_InterfaceDataTable hL_InterfaceDataTable = new H_Interface.HL_InterfaceDataTable();
			this.Adapter.Fill(hL_InterfaceDataTable);
			return hL_InterfaceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Interface.HL_InterfaceDataTable GetFrontRegInterface()
		{
			this.Adapter.SelectCommand = this.CommandCollection[3];
			H_Interface.HL_InterfaceDataTable hL_InterfaceDataTable = new H_Interface.HL_InterfaceDataTable();
			this.Adapter.Fill(hL_InterfaceDataTable);
			return hL_InterfaceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Interface.HL_InterfaceDataTable GetInterfaceByInterfaceID(int InterfaceID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[4];
			this.Adapter.SelectCommand.Parameters[0].Value = InterfaceID;
			H_Interface.HL_InterfaceDataTable hL_InterfaceDataTable = new H_Interface.HL_InterfaceDataTable();
			this.Adapter.Fill(hL_InterfaceDataTable);
			return hL_InterfaceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Interface.HL_InterfaceDataTable GetInterfaceNameID()
		{
			this.Adapter.SelectCommand = this.CommandCollection[5];
			H_Interface.HL_InterfaceDataTable hL_InterfaceDataTable = new H_Interface.HL_InterfaceDataTable();
			this.Adapter.Fill(hL_InterfaceDataTable);
			return hL_InterfaceDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(H_Interface.HL_InterfaceDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(H_Interface dataSet)
		{
			return this.Adapter.Update(dataSet, "HL_Interface");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Delete, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteInterface(int InterfaceID)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			sqlCommand.Parameters[0].Value = InterfaceID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
